import request from '@/utils/request'

export const loginApi = (data) => request.post('/sys/login', data)

export const getUserInfoApi = () => request.get('/sys/profile')

export const updatePassword = (data) => request.put('/sys/user/updatePass', data)

export const getUserDetailById = (id) => request.get(`/sys/user/${id}`)
// 获取用户扫码登录的加密串 用来生成二维码
export const getQrCodeKeyAPI = () => request.get('/sys/qrcodeKey')

export const getQrCodeStateAPI = (params) => request.get('/sys/qrcodeState', { params })

export const updateUserStaffPhotoAPI = (data) =>
  request.put('/sys/updateStaffPhoto', data)

// 获取用户消息
export const getUserMessageAPI = () => request.get('/sys/message')
// 删除用户信息
export const delUserMessageAPI = id => request.delete(`/sys/message/${id}`)
// 已读消息
export const updateUserMessageAPI = id => request.put(`/sys/message/${id}`)
